<?php

class ParentAction extends CommonAction {

     //建立自定义查询   
     /*
      function buildWhere()
      {
         return "";
      }
     */
     //操作初始化
     /*
     public function __construct() 
     {
         C("DB_PREFIX","");
         parent::__construct();
     }
     */
     
     function parentChild()
     {
      //  dump( $this->paras);
       
       $p=M("Parent");
       
       $p->paras=$this->paras;
       
       dump($p->paras);
       
     }

}


/*
class ParentAction extends Action{

    // 查询数据
    public function showParent(){
        $Form    = M("Parent");
        import("@.ORG.Page"); //导入分页类
        $count = $Form->count();    //计算总数
        $p = new Page ( $count, 5 );
       // $list    =    $Form->limit(5)->order('id desc')->findAll();
       $list=$Form->limit($p->firstRow.','.$p->listRows)->order('id desc')->findAll();
        $this->assign('list',$list);
        $page = $p->show (); 
        $this->assign('page',$page);
        $this->display();
    }
    // 写入数据
    public function insertParent() {
        $Form    =    D("Parent");
        if($vo = $Form->create()) {
            $list=$Form->add();
            if($list!==false){
                $this->success('数据保存成功！');
            }else{
                $this->error('数据写入错误！');
            }
        }else{
            $this->error($Form->getError());
        }
    }

    // 更新数据
    public function updateParent() {
        $Form    =    D("Parent");
        if($vo = $Form->create()) {
            $list=$Form->save();
            if($list!==false){
                $this->success('数据更新成功！');
            }else{
                $this->error("没有更新任何数据!");
            }
        }else{
            $this->error($Form->getError());
        }
    }
    // 删除数据
    public function deleteParent() {
        if(!empty($_POST['id'])) {
            $Form    =    M("Parent");
            $result    =    $Form->delete($_POST['id']);
            if(false !== $result) {
                $this->ajaxReturn($_POST['id'],'删除成功！',1);
            }else{
                $this->error('删除出错！');
            }
        }else{
            $this->error('删除项不存在！');
        }
    }

    // 编辑数据
    public function editParent() {
        if(!empty($_GET['id'])) {
            $Form    =    M("Parent");
            $vo    =    $Form->getById($_GET['id']);
            if($vo) {
                $this->assign('vo',$vo);
                $this->display();
            }else{
                exit('编辑项不存在！');
            }
        }else{
            exit('编辑项不存在！');
        }
    }

}

*/


?>